package jp.co.sapporobeer.FmcDialer.dbsync.data;

import java.io.IOException;
import java.util.ArrayList;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

import com.sun.jersey.core.util.Base64;

//import android.database.sqlite.SQLiteStatement;
import info.guardianproject.database.sqlcipher.SQLiteStatement;

public class UserPhoneFactory implements ListFactory {
	private String sqlKeyIns = "SQL_INSERT_USERPHONE";
	private String sqlKeyDel = "SQL_DELETE_USERPHONE";
	private ArrayList<ListRecord> list = new ArrayList<ListRecord>(); 
	
	public ListRecord getRecords(JsonParser jp) throws JsonParseException,IOException{
		 String id = "";
		 String dataDateTime = "";
		 String dataType = "";
		 String dataKey   = "";
		 String ip_Current_StartDatetime = "";
		 String ip_Current_UpcomingNo = "";
		 String ip_Current_DivisionNo = "";
		 String ip_Current_PhoneNo = "";
		 String ip_Next_StartDatetime = "";
		 String ip_Next_UpcomingNo = "";
		 String ip_Next_DivisionNo = "";
		 String ip_Next_PhoneNo = "";
		 String userNameA_First = "";
		 String userNameA_Middle = "";
		 String userNameA_Last = "";
		 String userNameA_Initial="";
		 String userNameA_Full = "";
		 String userNameW_First = "";
		 String userNameW_Middle = "";
		 String userNameW_Last = "";
		 String userNameW_Full = "";
		 String userNameK_First = "";
		 String userNameK_Middle = "";
		 String userNameK_Last = "";
		 String userNameK_Full = "";
		 String officeMail_PC = "";
		 String officeMail_Mobile = "";
		 String officePhone_Official  = "";
		 String officePhone_Department = "";
		 String officePhone_FAX = "";
		 String officePhone_Direct  = "";	
		 String officePhone_Direct_Key  = "";	
		 String officePhone_IpPhone  = "";	
		 String officePhone_IpPhone_Key  = "";	
		 String officePhone_Other  = "";	
		 String officePhone_Other_Key  = "";	
		 String officePhone_Mobile  = "";	
		 String officePhone_Mobile_Key  = "";	
		 String officeAddr_ZipCode = "";
		 String officeAddr_Country = "";
		 String officeAddr_State = "";
		 String officeAddr_Pref = "";
		 String officeAddr_City = "";
		 String officeAddr_Include = "";
		 String officeHomePage = "";	
		 String officeCompanyCd_0 = "";
		 String officeCompanyNameW_0 = "";
		 String officeDepartmentCd_0 = "";
		 String officeDepartmentNameW_0 = "";
		 String officeUserGrade_0 = "";
		 String officeCompanyCd_1 = "";
		 String officeCompanyNameW_1 = "";
		 String officeDepartmentCd_1 = "";
		 String officeDepartmentNameW_1 = "";
		 String officeUserGrade_1 = "";
		 String officeCompanyCd_2 = "";
		 String officeCompanyNameW_2 = "";
		 String officeDepartmentCd_2 = "";
		 String officeDepartmentNameW_2 = "";
		 String officeUserGrade_2 = "";
		 String officeCompanyCd_3 = "";
		 String officeCompanyNameW_3 = "";
		 String officeDepartmentCd_3 = "";
		 String officeDepartmentNameW_3 = "";
		 String officeUserGrade_3 = "";
		 String userFacePhoto = "";
		
        while (jp.nextToken() != JsonToken.END_OBJECT) {
            String name = jp.getCurrentName();
            jp.nextToken();
            if ("id".equals(name)) id = jp.getText();
            else if ("dataDateTime".equals(name)) dataDateTime = jp.getText();
            else if ("dataType".equals(name)) dataType = jp.getText();
            else if ("dataKey".equals(name)) dataKey   = jp.getText();
            else if ("ip_Current_StartDatetime".equals(name)) ip_Current_StartDatetime = jp.getText();
            else if ("ip_Current_UpcomingNo".equals(name)) ip_Current_UpcomingNo = jp.getText();
            else if ("ip_Current_DivisionNo".equals(name)) ip_Current_DivisionNo = jp.getText();
            else if ("ip_Current_PhoneNo".equals(name)) ip_Current_PhoneNo = jp.getText();
            else if ("ip_Next_StartDatetime".equals(name)) ip_Next_StartDatetime = jp.getText();
            else if ("ip_Next_UpcomingNo".equals(name)) ip_Next_UpcomingNo = jp.getText();
            else if ("ip_Next_DivisionNo".equals(name)) ip_Next_DivisionNo = jp.getText();
            else if ("ip_Next_PhoneNo".equals(name)) ip_Next_PhoneNo = jp.getText();
            else if ("userNameA_First".equals(name)) userNameA_First = jp.getText();
            else if ("userNameA_Middle".equals(name)) userNameA_Middle = jp.getText();
            else if ("userNameA_Last".equals(name)) userNameA_Last = jp.getText();
            else if ("userNameA_Initial".equals(name)) userNameA_Initial = jp.getText();
            else if ("userNameA_Full".equals(name)) userNameA_Full = jp.getText();
            else if ("userNameW_First".equals(name)) userNameW_First = jp.getText();
            else if ("userNameW_Middle".equals(name)) userNameW_Middle = jp.getText();
            else if ("userNameW_Last".equals(name)) userNameW_Last = jp.getText();
            else if ("userNameW_Full".equals(name)) userNameW_Full = jp.getText();
            else if ("userNameK_First".equals(name)) userNameK_First = jp.getText();
            else if ("userNameK_Middle".equals(name)) userNameK_Middle = jp.getText();
            else if ("userNameK_Last".equals(name)) userNameK_Last = jp.getText();
            else if ("userNameK_Full".equals(name)) userNameK_Full = jp.getText();
            else if ("officeMail_PC".equals(name)) officeMail_PC = jp.getText();
            else if ("officeMail_Mobile".equals(name)) officeMail_Mobile = jp.getText();
            else if ("officePhone_Official".equals(name)) officePhone_Official  = jp.getText();
            else if ("officePhone_Department".equals(name)) officePhone_Department = jp.getText();
            else if ("officePhone_FAX".equals(name)) officePhone_FAX = jp.getText();            
            else if ("officePhone_Direct".equals(name)) officePhone_Direct  = jp.getText();
            else if ("officePhone_Direct_Key".equals(name)) officePhone_Direct_Key  = jp.getText();
            else if ("officePhone_IpPhone".equals(name)) officePhone_IpPhone  = jp.getText();
            else if ("officePhone_IpPhone_Key".equals(name)) officePhone_IpPhone_Key  = jp.getText();
            else if ("officePhone_Other".equals(name)) officePhone_Other  = jp.getText();
            else if ("officePhone_Other_Key".equals(name)) officePhone_Other_Key  = jp.getText();
            else if ("officePhone_Mobile".equals(name)) officePhone_Mobile  = jp.getText();
            else if ("officePhone_Mobile_Key".equals(name)) officePhone_Mobile_Key  = jp.getText();
            else if ("officeAddr_ZipCode".equals(name)) officeAddr_ZipCode = jp.getText();
            else if ("officeAddr_Country".equals(name)) officeAddr_Country = jp.getText();
            else if ("officeAddr_State".equals(name)) officeAddr_State = jp.getText();
            else if ("officeAddr_Pref".equals(name)) officeAddr_Pref = jp.getText();
            else if ("officeAddr_City".equals(name)) officeAddr_City = jp.getText();
            else if ("officeAddr_Include".equals(name)) officeAddr_Include = jp.getText();
            else if ("officeHomePage".equals(name)) officeHomePage = jp.getText();            
            else if ("officeCompanyCd_0".equals(name)) officeCompanyCd_0 = jp.getText();
            else if ("officeCompanyNameW_0".equals(name)) officeCompanyNameW_0 = jp.getText();
            else if ("officeDepartmentCd_0".equals(name)) officeDepartmentCd_0 = jp.getText();
            else if ("officeDepartmentNameW_0".equals(name)) officeDepartmentNameW_0 = jp.getText();
            else if ("officeUserGrade_0".equals(name)) officeUserGrade_0 = jp.getText();
            else if ("officeCompanyCd_1".equals(name)) officeCompanyCd_1 = jp.getText();
            else if ("officeCompanyNameW_1".equals(name)) officeCompanyNameW_1 = jp.getText();
            else if ("officeDepartmentCd_1".equals(name)) officeDepartmentCd_1 = jp.getText();
            else if ("officeDepartmentNameW_1".equals(name)) officeDepartmentNameW_1 = jp.getText();
            else if ("officeUserGrade_1".equals(name)) officeUserGrade_1 = jp.getText();
            else if ("officeCompanyCd_2".equals(name)) officeCompanyCd_2 = jp.getText();
            else if ("officeCompanyNameW_2".equals(name)) officeCompanyNameW_2 = jp.getText();
            else if ("officeDepartmentCd_2".equals(name)) officeDepartmentCd_2 = jp.getText();
            else if ("officeDepartmentNameW_2".equals(name)) officeDepartmentNameW_2 = jp.getText();
            else if ("officeUserGrade_2".equals(name)) officeUserGrade_2 = jp.getText();
            else if ("officeCompanyCd_3".equals(name)) officeCompanyCd_3 = jp.getText();
            else if ("officeCompanyNameW_3".equals(name)) officeCompanyNameW_3 = jp.getText();
            else if ("officeDepartmentCd_3".equals(name)) officeDepartmentCd_3 = jp.getText();
            else if ("officeDepartmentNameW_3".equals(name)) officeDepartmentNameW_3 = jp.getText();
            else if ("officeUserGrade_3".equals(name)) officeUserGrade_3 = jp.getText();
            else if ("userFacePhoto".equals(name)) userFacePhoto = jp.getText();
            else jp.skipChildren();
        }
        ListRecord rec = new UserPhoneRecord(id,dataDateTime,dataType,dataKey,
    			ip_Current_StartDatetime,ip_Current_UpcomingNo,
    			ip_Current_DivisionNo,ip_Current_PhoneNo,
    			ip_Next_StartDatetime,ip_Next_UpcomingNo,
    			ip_Next_DivisionNo,ip_Next_PhoneNo,userNameA_First,
    			userNameA_Middle,userNameA_Last,userNameA_Initial,
    			userNameA_Full,userNameW_First,userNameW_Middle,
    			userNameW_Last,userNameW_Full,userNameK_First,
    			userNameK_Middle,userNameK_Last,userNameK_Full,
    			officeMail_PC,officeMail_Mobile,officePhone_Official ,
    			officePhone_Department,officePhone_FAX,officePhone_Direct ,
    			officePhone_Direct_Key ,officePhone_IpPhone ,officePhone_IpPhone_Key ,
    			officePhone_Other ,officePhone_Other_Key ,officePhone_Mobile ,
    			officePhone_Mobile_Key ,officeAddr_ZipCode,officeAddr_Country,
    			officeAddr_State,officeAddr_Pref,officeAddr_City,
    			officeAddr_Include,officeHomePage,officeCompanyCd_0,
    			officeCompanyNameW_0,officeDepartmentCd_0,officeDepartmentNameW_0,
    			officeUserGrade_0,officeCompanyCd_1,officeCompanyNameW_1,
    			officeDepartmentCd_1,officeDepartmentNameW_1,officeUserGrade_1,
    			officeCompanyCd_2,officeCompanyNameW_2,officeDepartmentCd_2,
    			officeDepartmentNameW_2,officeUserGrade_2,officeCompanyCd_3,
    			officeCompanyNameW_3,officeDepartmentCd_3,officeDepartmentNameW_3,
    			officeUserGrade_3,userFacePhoto
    			);
        return rec;
	}
	
	public ListRecord getSingleRecord(JsonParser jp) throws JsonParseException,IOException{
		 String id = "";
		 String dataDateTime = "";
		 String dataType = "";
		 String dataKey   = "";
		 String ip_Current_StartDatetime = "";
		 String ip_Current_UpcomingNo = "";
		 String ip_Current_DivisionNo = "";
		 String ip_Current_PhoneNo = "";
		 String ip_Next_StartDatetime = "";
		 String ip_Next_UpcomingNo = "";
		 String ip_Next_DivisionNo = "";
		 String ip_Next_PhoneNo = "";
		 String userNameA_First = "";
		 String userNameA_Middle = "";
		 String userNameA_Last = "";
		 String userNameA_Initial="";
		 String userNameA_Full = "";
		 String userNameW_First = "";
		 String userNameW_Middle = "";
		 String userNameW_Last = "";
		 String userNameW_Full = "";
		 String userNameK_First = "";
		 String userNameK_Middle = "";
		 String userNameK_Last = "";
		 String userNameK_Full = "";
		 String officeMail_PC = "";
		 String officeMail_Mobile = "";
		 String officePhone_Official  = "";
		 String officePhone_Department = "";
		 String officePhone_FAX = "";
		 String officePhone_Direct  = "";	
		 String officePhone_Direct_Key  = "";	
		 String officePhone_IpPhone  = "";	
		 String officePhone_IpPhone_Key  = "";	
		 String officePhone_Other  = "";	
		 String officePhone_Other_Key  = "";	
		 String officePhone_Mobile  = "";	
		 String officePhone_Mobile_Key  = "";	
		 String officeAddr_ZipCode = "";
		 String officeAddr_Country = "";
		 String officeAddr_State = "";
		 String officeAddr_Pref = "";
		 String officeAddr_City = "";
		 String officeAddr_Include = "";
		 String officeHomePage = "";	
		 String officeCompanyCd_0 = "";
		 String officeCompanyNameW_0 = "";
		 String officeDepartmentCd_0 = "";
		 String officeDepartmentNameW_0 = "";
		 String officeUserGrade_0 = "";
		 String officeCompanyCd_1 = "";
		 String officeCompanyNameW_1 = "";
		 String officeDepartmentCd_1 = "";
		 String officeDepartmentNameW_1 = "";
		 String officeUserGrade_1 = "";
		 String officeCompanyCd_2 = "";
		 String officeCompanyNameW_2 = "";
		 String officeDepartmentCd_2 = "";
		 String officeDepartmentNameW_2 = "";
		 String officeUserGrade_2 = "";
		 String officeCompanyCd_3 = "";
		 String officeCompanyNameW_3 = "";
		 String officeDepartmentCd_3 = "";
		 String officeDepartmentNameW_3 = "";
		 String officeUserGrade_3 = "";
		 String userFacePhoto = "";

		 while (jp.getCurrentToken() != JsonToken.END_OBJECT) {
            String name = jp.getCurrentName();
            jp.nextToken();
            if ("id".equals(name)) id = jp.getText();
            else if ("dataDateTime".equals(name)) dataDateTime = jp.getText();
            else if ("dataType".equals(name)) dataType = jp.getText();
            else if ("dataKey".equals(name)) dataKey   = jp.getText();
            else if ("ip_Current_StartDatetime".equals(name)) ip_Current_StartDatetime = jp.getText();
            else if ("ip_Current_UpcomingNo".equals(name)) ip_Current_UpcomingNo = jp.getText();
            else if ("ip_Current_DivisionNo".equals(name)) ip_Current_DivisionNo = jp.getText();
            else if ("ip_Current_PhoneNo".equals(name)) ip_Current_PhoneNo = jp.getText();
            else if ("ip_Next_StartDatetime".equals(name)) ip_Next_StartDatetime = jp.getText();
            else if ("ip_Next_UpcomingNo".equals(name)) ip_Next_UpcomingNo = jp.getText();
            else if ("ip_Next_DivisionNo".equals(name)) ip_Next_DivisionNo = jp.getText();
            else if ("ip_Next_PhoneNo".equals(name)) ip_Next_PhoneNo = jp.getText();
            else if ("userNameA_First".equals(name)) userNameA_First = jp.getText();
            else if ("userNameA_Middle".equals(name)) userNameA_Middle = jp.getText();
            else if ("userNameA_Last".equals(name)) userNameA_Last = jp.getText();
            else if ("userNameA_Initial".equals(name)) userNameA_Initial = jp.getText();
            else if ("userNameA_Full".equals(name)) userNameA_Full = jp.getText();
            else if ("userNameW_First".equals(name)) userNameW_First = jp.getText();
            else if ("userNameW_Middle".equals(name)) userNameW_Middle = jp.getText();
            else if ("userNameW_Last".equals(name)) userNameW_Last = jp.getText();
            else if ("userNameW_Full".equals(name)) userNameW_Full = jp.getText();
            else if ("userNameK_First".equals(name)) userNameK_First = jp.getText();
            else if ("userNameK_Middle".equals(name)) userNameK_Middle = jp.getText();
            else if ("userNameK_Last".equals(name)) userNameK_Last = jp.getText();
            else if ("userNameK_Full".equals(name)) userNameK_Full = jp.getText();
            else if ("officeMail_PC".equals(name)) officeMail_PC = jp.getText();
            else if ("officeMail_Mobile".equals(name)) officeMail_Mobile = jp.getText();
            else if ("officePhone_Official".equals(name)) officePhone_Official  = jp.getText();
            else if ("officePhone_Department".equals(name)) officePhone_Department = jp.getText();
            else if ("officePhone_FAX".equals(name)) officePhone_FAX = jp.getText();            
            else if ("officePhone_Direct".equals(name)) officePhone_Direct  = jp.getText();
            else if ("officePhone_Direct_Key".equals(name)) officePhone_Direct_Key  = jp.getText();
            else if ("officePhone_IpPhone".equals(name)) officePhone_IpPhone  = jp.getText();
            else if ("officePhone_IpPhone_Key".equals(name)) officePhone_IpPhone_Key  = jp.getText();
            else if ("officePhone_Other".equals(name)) officePhone_Other  = jp.getText();
            else if ("officePhone_Other_Key".equals(name)) officePhone_Other_Key  = jp.getText();
            else if ("officePhone_Mobile".equals(name)) officePhone_Mobile  = jp.getText();
            else if ("officePhone_Mobile_Key".equals(name)) officePhone_Mobile_Key  = jp.getText();
            else if ("officeAddr_ZipCode".equals(name)) officeAddr_ZipCode = jp.getText();
            else if ("officeAddr_Country".equals(name)) officeAddr_Country = jp.getText();
            else if ("officeAddr_State".equals(name)) officeAddr_State = jp.getText();
            else if ("officeAddr_Pref".equals(name)) officeAddr_Pref = jp.getText();
            else if ("officeAddr_City".equals(name)) officeAddr_City = jp.getText();
            else if ("officeAddr_Include".equals(name)) officeAddr_Include = jp.getText();
            else if ("officeHomePage".equals(name)) officeHomePage = jp.getText();            
            else if ("officeCompanyCd_0".equals(name)) officeCompanyCd_0 = jp.getText();
            else if ("officeCompanyNameW_0".equals(name)) officeCompanyNameW_0 = jp.getText();
            else if ("officeDepartmentCd_0".equals(name)) officeDepartmentCd_0 = jp.getText();
            else if ("officeDepartmentNameW_0".equals(name)) officeDepartmentNameW_0 = jp.getText();
            else if ("officeUserGrade_0".equals(name)) officeUserGrade_0 = jp.getText();
            else if ("officeCompanyCd_1".equals(name)) officeCompanyCd_1 = jp.getText();
            else if ("officeCompanyNameW_1".equals(name)) officeCompanyNameW_1 = jp.getText();
            else if ("officeDepartmentCd_1".equals(name)) officeDepartmentCd_1 = jp.getText();
            else if ("officeDepartmentNameW_1".equals(name)) officeDepartmentNameW_1 = jp.getText();
            else if ("officeUserGrade_1".equals(name)) officeUserGrade_1 = jp.getText();
            else if ("officeCompanyCd_2".equals(name)) officeCompanyCd_2 = jp.getText();
            else if ("officeCompanyNameW_2".equals(name)) officeCompanyNameW_2 = jp.getText();
            else if ("officeDepartmentCd_2".equals(name)) officeDepartmentCd_2 = jp.getText();
            else if ("officeDepartmentNameW_2".equals(name)) officeDepartmentNameW_2 = jp.getText();
            else if ("officeUserGrade_2".equals(name)) officeUserGrade_2 = jp.getText();
            else if ("officeCompanyCd_3".equals(name)) officeCompanyCd_3 = jp.getText();
            else if ("officeCompanyNameW_3".equals(name)) officeCompanyNameW_3 = jp.getText();
            else if ("officeDepartmentCd_3".equals(name)) officeDepartmentCd_3 = jp.getText();
            else if ("officeDepartmentNameW_3".equals(name)) officeDepartmentNameW_3 = jp.getText();
            else if ("officeUserGrade_3".equals(name)) officeUserGrade_3 = jp.getText();
            else if ("userFacePhoto".equals(name)) userFacePhoto = jp.getText();
            else jp.skipChildren();
            jp.nextToken();
        }
        ListRecord rec = new UserPhoneRecord(id,dataDateTime,dataType,dataKey,
    			ip_Current_StartDatetime,ip_Current_UpcomingNo,
    			ip_Current_DivisionNo,ip_Current_PhoneNo,
    			ip_Next_StartDatetime,ip_Next_UpcomingNo,
    			ip_Next_DivisionNo,ip_Next_PhoneNo,userNameA_First,
    			userNameA_Middle,userNameA_Last,userNameA_Initial,
    			userNameA_Full,userNameW_First,userNameW_Middle,
    			userNameW_Last,userNameW_Full,userNameK_First,
    			userNameK_Middle,userNameK_Last,userNameK_Full,
    			officeMail_PC,officeMail_Mobile,officePhone_Official ,
    			officePhone_Department,officePhone_FAX,officePhone_Direct ,
    			officePhone_Direct_Key ,officePhone_IpPhone ,officePhone_IpPhone_Key ,
    			officePhone_Other ,officePhone_Other_Key ,officePhone_Mobile ,
    			officePhone_Mobile_Key ,officeAddr_ZipCode,officeAddr_Country,
    			officeAddr_State,officeAddr_Pref,officeAddr_City,
    			officeAddr_Include,officeHomePage,officeCompanyCd_0,
    			officeCompanyNameW_0,officeDepartmentCd_0,officeDepartmentNameW_0,
    			officeUserGrade_0,officeCompanyCd_1,officeCompanyNameW_1,
    			officeDepartmentCd_1,officeDepartmentNameW_1,officeUserGrade_1,
    			officeCompanyCd_2,officeCompanyNameW_2,officeDepartmentCd_2,
    			officeDepartmentNameW_2,officeUserGrade_2,officeCompanyCd_3,
    			officeCompanyNameW_3,officeDepartmentCd_3,officeDepartmentNameW_3,
    			officeUserGrade_3,userFacePhoto
    			);
		return rec;
	}
	
	public void add(ListRecord rec){
		list.add(rec);
	}
	
	public ArrayList<ListRecord> getList(){
		return list;
	}
	
	public String getSqlKeyIns(){
		return sqlKeyIns;
	}

	public String getSqlKeyDel(){
		return sqlKeyDel;
	}

	public void bindRecord(SQLiteStatement stmt,ListRecord rec){
		stmt.bindLong(1,Integer.parseInt(((UserPhoneRecord)rec).getId()));
		stmt.bindString(2,((UserPhoneRecord)rec).getDataDateTime());
		stmt.bindLong(3,Integer.parseInt(((UserPhoneRecord)rec).getDataType()));
		stmt.bindString(4,((UserPhoneRecord)rec).getDataKey());
		stmt.bindString(5,((UserPhoneRecord)rec).getIp_Current_StartDatetime());
		stmt.bindString(6,((UserPhoneRecord)rec).getIp_Current_UpcomingNo());
		stmt.bindString(7,((UserPhoneRecord)rec).getIp_Current_DivisionNo());
		stmt.bindString(8,((UserPhoneRecord)rec).getIp_Current_PhoneNo());
		stmt.bindString(9,((UserPhoneRecord)rec).getIp_Next_StartDatetime());
		stmt.bindString(10,((UserPhoneRecord)rec).getIp_Next_UpcomingNo());
		stmt.bindString(11,((UserPhoneRecord)rec).getIp_Next_DivisionNo());
		stmt.bindString(12,((UserPhoneRecord)rec).getIp_Next_PhoneNo());
		stmt.bindString(13,((UserPhoneRecord)rec).getUserNameA_First());
		stmt.bindString(14,((UserPhoneRecord)rec).getUserNameA_Middle());
		stmt.bindString(15,((UserPhoneRecord)rec).getUserNameA_Last());
		stmt.bindString(16,((UserPhoneRecord)rec).getUserNameA_Initial());
		stmt.bindString(17,((UserPhoneRecord)rec).getUserNameA_Full());
		stmt.bindString(18,((UserPhoneRecord)rec).getUserNameW_First());
		stmt.bindString(19,((UserPhoneRecord)rec).getUserNameW_Middle());
		stmt.bindString(20,((UserPhoneRecord)rec).getUserNameW_Last());
		stmt.bindString(21,((UserPhoneRecord)rec).getUserNameW_Full());
		stmt.bindString(22,((UserPhoneRecord)rec).getUserNameK_First());
		stmt.bindString(23,((UserPhoneRecord)rec).getUserNameK_Middle());
		stmt.bindString(24,((UserPhoneRecord)rec).getUserNameK_Last());
		stmt.bindString(25,((UserPhoneRecord)rec).getUserNameK_Full());
		stmt.bindString(26,((UserPhoneRecord)rec).getOfficeMail_PC());
		stmt.bindString(27,((UserPhoneRecord)rec).getOfficeMail_Mobile());
		stmt.bindString(28,((UserPhoneRecord)rec).getOfficePhone_Official());
		stmt.bindString(29,((UserPhoneRecord)rec).getOfficePhone_Department());
		stmt.bindString(30,((UserPhoneRecord)rec).getOfficePhone_FAX());
		stmt.bindString(31,((UserPhoneRecord)rec).getOfficePhone_Direct());
		stmt.bindString(32,((UserPhoneRecord)rec).getOfficePhone_Direct_Key());
		stmt.bindString(33,((UserPhoneRecord)rec).getOfficePhone_IpPhone());
		stmt.bindString(34,((UserPhoneRecord)rec).getOfficePhone_IpPhone_Key());
		stmt.bindString(35,((UserPhoneRecord)rec).getOfficePhone_Other());
		stmt.bindString(36,((UserPhoneRecord)rec).getOfficePhone_Other_Key());
		stmt.bindString(37,((UserPhoneRecord)rec).getOfficePhone_Mobile());
		stmt.bindString(38,((UserPhoneRecord)rec).getOfficePhone_Mobile_Key());
		stmt.bindString(39,((UserPhoneRecord)rec).getOfficeAddr_ZipCode());
		stmt.bindString(40,((UserPhoneRecord)rec).getOfficeAddr_Country());
		stmt.bindString(41,((UserPhoneRecord)rec).getOfficeAddr_State());
		stmt.bindString(42,((UserPhoneRecord)rec).getOfficeAddr_Pref());
		stmt.bindString(43,((UserPhoneRecord)rec).getOfficeAddr_City());
		stmt.bindString(44,((UserPhoneRecord)rec).getOfficeAddr_Include());
		stmt.bindString(45,((UserPhoneRecord)rec).getOfficeHomePage());
		stmt.bindString(46,((UserPhoneRecord)rec).getOfficeCompanyCd_0());
		stmt.bindString(47,((UserPhoneRecord)rec).getOfficeCompanyNameW_0());
		stmt.bindString(48,((UserPhoneRecord)rec).getOfficeDepartmentCd_0());
		stmt.bindString(49,((UserPhoneRecord)rec).getOfficeDepartmentNameW_0());
		stmt.bindString(50,((UserPhoneRecord)rec).getOfficeUserGrade_0());
		stmt.bindString(51,((UserPhoneRecord)rec).getOfficeCompanyCd_1());
		stmt.bindString(52,((UserPhoneRecord)rec).getOfficeCompanyNameW_1());
		stmt.bindString(53,((UserPhoneRecord)rec).getOfficeDepartmentCd_1());
		stmt.bindString(54,((UserPhoneRecord)rec).getOfficeDepartmentNameW_1());
		stmt.bindString(55,((UserPhoneRecord)rec).getOfficeUserGrade_1());
		stmt.bindString(56,((UserPhoneRecord)rec).getOfficeCompanyCd_2());
		stmt.bindString(57,((UserPhoneRecord)rec).getOfficeCompanyNameW_2());
		stmt.bindString(58,((UserPhoneRecord)rec).getOfficeDepartmentCd_2());
		stmt.bindString(59,((UserPhoneRecord)rec).getOfficeDepartmentNameW_2());
		stmt.bindString(60,((UserPhoneRecord)rec).getOfficeUserGrade_2());
		stmt.bindString(61,((UserPhoneRecord)rec).getOfficeCompanyCd_3());
		stmt.bindString(62,((UserPhoneRecord)rec).getOfficeCompanyNameW_3());
		stmt.bindString(63,((UserPhoneRecord)rec).getOfficeDepartmentCd_3());
		stmt.bindString(64,((UserPhoneRecord)rec).getOfficeDepartmentNameW_3());
		stmt.bindString(65,((UserPhoneRecord)rec).getOfficeUserGrade_3());
		stmt.bindBlob(66, Base64.encode(((UserPhoneRecord)rec).getUserFacePhoto()));
	}
}
